using System.Linq;
using NHibernate;
using NHibernate.Linq;
using Sample.Domain;

namespace Sample.Persistence
{
    /// <summary>
    /// This is like a LINQ to SQL data context class
    /// except supporting NHibernate
    /// </summary>
    public class DatabaseContext : NHibernateContext
    {
        public DatabaseContext(ISession session) : base(session)
        {
        }

        public IOrderedQueryable<Person> People
        {
            get { return Session.Linq<Person>(); }
        }

        public IOrderedQueryable<PeerReview> PeerReviews
        {
            get { return Session.Linq<PeerReview>(); }
        }

        public IOrderedQueryable<ReviewerForReview> ReviewersForReviews
        {
            get { return Session.Linq<ReviewerForReview>(); }
        }
    }
}